Merged
Conversation
There was a problem hiding this comment.
Pull request overview
This PR delivers a set of import/navigation/share bugfixes across the app, including improved file-origin detection for imports, more reliable dismissal behavior for media server flows, and a safer debug-info export path on iOS-app-on-Mac.
Changes:
- Add path-based helpers to distinguish app-managed import sources (Documents + App Group SharedFiles) and use them to avoid circular imports and to delete copied source files appropriately.
- Replace
ShareLink + Transferableon iOS-app-on-Mac with afileExporterflow using an explicit default filename to avoid a macOS share crash. - Improve presentation/dismissal behavior by swallowing “missing file” preload errors and wiring navigation dismissal closures for Jellyfin/AudiobookShelf download flows.
Reviewed changes
Copilot reviewed 10 out of 10 changed files in this pull request and generated 3 comments.
Show a summary per file
| File | Description |
|---|---|
| Shared/CoreData/DataManager.swift | Introduces isInDocumentsFolder and isAppManagedSource helpers for safer import/source classification. |
| BookPlayer/Settings/SettingsView.swift | Adds a loading overlay at the Settings root level. |
| BookPlayer/Settings/Sections/SettingsSupportSectionView.swift | Switches debug info sharing to fileExporter on iOS-app-on-Mac; adds loading-state usage and document state. |
| BookPlayer/Settings/Sections/DebugFileTransferable.swift | Refactors debug data generation into generateDebugData() and adds a FileDocument wrapper for exporting. |
| BookPlayer/MediaServerIntegration/BPNavigation.swift | Changes dismissal from DismissAction to a generic closure. |
| BookPlayer/Library/ItemList/LibraryRootView.swift | Silently ignores fileMissing during cold-launch preload to avoid presentation races. |
| BookPlayer/Library/ItemList/ItemListViewModel.swift | Updates circular-import prevention to use isInDocumentsFolder. |
| BookPlayer/Jellyfin/JellyfinRootView.swift | Wires navigation.dismiss to onDismiss so download flows can dismiss correctly. |
| BookPlayer/Import/Models/ImportOperation.swift | Uses isAppManagedSource to delete copied sources from Documents/SharedFiles; improves folder-name detection exclusions. |
| BookPlayer/AudiobookShelf/AudiobookShelfRootView.swift | Wires navigation.dismiss to onDismiss so download flows can dismiss correctly. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Comment on lines
+105
to
+112
| .fileExporter( | ||
| isPresented: $isExportingDebugFile, | ||
| document: debugDocument, | ||
| contentType: .plainText, | ||
| defaultFilename: "bookplayer_debug_information" | ||
| ) { _ in | ||
| debugDocument = nil | ||
| } |
Comment on lines
+93
to
+98
| Task { | ||
| loadingState.show = true | ||
| let data = await file.generateDebugData() | ||
| loadingState.show = false | ||
| debugDocument = DebugFileDocument(data: data) | ||
| isExportingDebugFile = true |
Comment on lines
+190
to
193
| if DataManager.isAppManagedSource(fileURL) { | ||
| fileURL.disableFileProtection() | ||
| try? FileManager.default.removeItem(at: fileURL) | ||
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Bugfix